package com.example.apricots.Net;

import com.example.apricots.Net.Request.RLogin;
import com.example.apricots.Net.Request.RRegist;
import com.example.apricots.Net.bean.CommonBean;


import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 *  存放api接口
 */
public interface CommonServices {

    String HEADER_REQUEST = "Content-Type:application/json";
    String HEADER_REQUEST1 = "Content-Type:text/html";

    //此类请求(带请求头@Body)最好使用POST，GET请求会响应不到
    @Headers(HEADER_REQUEST)
    @POST("apricots/login/{id}")
    Call<ResponseBody> login(@Path("id")int id, @Body RLogin login);


    @Headers(HEADER_REQUEST)
    @POST("apricots/addUser")
    Call<ResponseBody> addUser(@Body RRegist regist);


}
